package com.styytech.dadabao.ui.more;


import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.lidroid.xutils.view.annotation.ContentView;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.styytech.dadabao.DadaApplication;
import com.styytech.dadabao.R;
import com.styytech.dadabao.base.BaseActivity;

/**
 * 帮助中心详情
 */
@ContentView(R.layout.activity_help_details)
public class HelpCenterDetailsActivity extends BaseActivity {

    /*内容1整体*/
    @ViewInject(R.id.llyt_content1)
    LinearLayout llyt_content1;
    /*标题*/
    @ViewInject(R.id.tv_title)
    TextView tv_title;
    /*内容1*/
    @ViewInject(R.id.tv_content1)
    TextView tv_content1;
    /*内容2整体*/
    @ViewInject(R.id.llyt_content2)
    LinearLayout llyt_content2;
    /*内容1*/
    @ViewInject(R.id.tv_content2)
    TextView tv_content2;
    /*上下文*/
    private Context mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        initView();
        initData();
    }

    /**
     * 初始化视图
     */
    private void initView() {
        DadaApplication.addActivity(this);
        setTopBar("帮助中心", View.VISIBLE);

    }

    /**
     * 初始界面设置
     */
    private void initData() {
        String title ;
        String content1 ;
        String content2 ;

        title = getIntent().getStringExtra("title");
        content1 = getIntent().getStringExtra("content1");
        content2 = getIntent().getStringExtra("content2");

        tv_title.setText(title);
        tv_content1.setText(content1);
        tv_content2.setText(content2);

        if(content1.isEmpty()){
            llyt_content1.setVisibility(View.GONE);
        }
        if(content2.isEmpty()){
            llyt_content2.setVisibility(View.GONE);
        }

    }

}

